package com.application.lucky.bean.sqliteBean;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.Objects;

@Entity
public class BankBean implements Parcelable {
    @Id(autoincrement = true)
    public Long id;
    public String name;
    public String userId;
    public String num;
    public String accountNamw;
    public String accountAddress;
    public String requestId;
    @Generated(hash = 1009097152)
    public BankBean(Long id, String name, String userId, String num, String accountNamw,
            String accountAddress, String requestId) {
        this.id = id;
        this.name = name;
        this.userId = userId;
        this.num = num;
        this.accountNamw = accountNamw;
        this.accountAddress = accountAddress;
        this.requestId = requestId;
    }
    @Generated(hash = 1512845509)
    public BankBean() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getNum() {
        return this.num;
    }
    public void setNum(String num) {
        this.num = num;
    }
    public String getAccountNamw() {
        return this.accountNamw;
    }
    public void setAccountNamw(String accountNamw) {
        this.accountNamw = accountNamw;
    }
    public String getAccountAddress() {
        return this.accountAddress;
    }
    public void setAccountAddress(String accountAddress) {
        this.accountAddress = accountAddress;
    }
    public String getUserId() {
        return this.userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.name);
        dest.writeString(this.userId);
        dest.writeString(this.num);
        dest.writeString(this.accountNamw);
        dest.writeString(this.accountAddress);
        dest.writeString(this.requestId);
    }

    protected BankBean(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.name = in.readString();
        this.userId = in.readString();
        this.num = in.readString();
        this.accountNamw = in.readString();
        this.accountAddress = in.readString();
        this.requestId = in.readString();
    }

    public static final Parcelable.Creator<BankBean> CREATOR = new Parcelable.Creator<BankBean>() {
        @Override
        public BankBean createFromParcel(Parcel source) {
            return new BankBean(source);
        }

        @Override
        public BankBean[] newArray(int size) {
            return new BankBean[size];
        }
    };

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BankBean bankBean = (BankBean) o;
        return TextUtils.equals(num, bankBean.num);
    }

    @Override
    public int hashCode() {
        return Objects.hash(num);
    }
}
